
<div class="layuimini-container">
<div class="layui-row">
    <form id="app-form" class="layui-form layuimini-form" autocomplate="off">
    <div class="layui-form-item">
        <label class="layui-form-label">商机名称：</label>
        <div class="layui-input-inline">
            <input type="text" name="name" lay-verify="required" lay-reqtext="商机名称不能为空" placeholder="请输入商机名称"
                value="" class="layui-input field-name">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">客户名称：</label>
        <div class="layui-input-inline">
			<div id="customer" class="xm-select-demo"></div>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">关联商品：</label>
        <div class="layui-input-block">
			<div id="product" class="xm-select-demo"></div>
		</div>
    </div>
	<div class="layui-form-item">
        <label class="layui-form-label">预计成交时间：</label>
        <div class="layui-input-inline">
            <input type="text" name="deal_time" class="layui-input field-deal_time" data-date>
        </div>
		<div class="layui-form-mid layui-word-aux">日期面板左下角可选择跟进具体时间</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">下次跟进时间：</label>
        <div class="layui-input-inline">
            <input type="text" name="next_time" class="layui-input field-next_time" data-date>
        </div>
		<div class="layui-form-mid layui-word-aux">日期面板左下角可选择跟进具体时间</div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">备注：</label>
        <div class="layui-input-block">
		  <textarea name="remark" placeholder="请输入内容" class="layui-textarea field-remark"></textarea>
		</div>
    </div>
    <input type="hidden" class="field-id" name="id">
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn layui-btn-normal" lay-submit lay-filter="saveBtn">确认保存</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
    </form>
</div>
<div class="layui-row">
	<table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
</div>
</div>

<script>
var customer = xmSelect.render({
	el: '#customer',
	name:'customer_id',
	radio:true,
	filterable: true,
	data: JSON.parse('{:json_encode($customerOwnerList)}')
});

var product = xmSelect.render({
	el: '#product', 
	name:'product_ids',
	filterable: true,
	data: JSON.parse('{:json_encode($currentCourseList)}')
});
layui.config({
    base: '/static/crm/js/modules/' //假设这是你存放拓展模块的根目录
});
layui.use(['form','jquery', 'layer', 'func'], function () {
    var form = layui.form,
        layer = layui.layer,
        $ = layui.jquery;
    var data = {:json_encode($data)}[0];
    customer.update({
        data: [{
            value:data.value,
            name:data.name,
            selected: true
        }],
    })
    layui.func.assign({:json_encode($data)});   // 解析数据
});
</script>

</body>
</html>